import { lazy } from "react";
import {
    DesktopOutlined,
    FileOutlined,
    PieChartOutlined,
    TeamOutlined,
} from '@ant-design/icons';

const Login = lazy(() => import("../pages/login/Index"));
const Main = lazy(() => import("../pages/main/Index"));
const Error = lazy(() => import("../pages/error/Index"));

const Home = lazy(() => import("../pages/home/Index"));
const Index = lazy(() => import("../pages/index/Index"));
const User = lazy(() => import("../pages/user/Index"));
const Indexa = lazy(() => import("../pages/index/indexa/Index"));

export const homeroute = [
    {
        path: '/',
        element: <Home></Home>,
        title: '首页',
        icon: <DesktopOutlined></DesktopOutlined>
    },
    {
        path: '/index',
        element: <Index></Index>,
        title: '分类',
        icon: <FileOutlined></FileOutlined>,
        children: [
            {
                path: '/index/indexa',
                element: <Indexa></Indexa>,
                title: '分类1',
                icon: <TeamOutlined></TeamOutlined>
            }
        ]
    },
    {
        path: '/user',
        element: <User></User>,
        title: '我的',
        icon: <PieChartOutlined></PieChartOutlined>
    }
]

export const route = [
    {
        path: '/',
        element: <Main></Main>,
        children:homeroute
    },
    {
        path: '/login',
        element: <Login></Login>
    },
    {
        path: '*',
        element: <Error></Error>
    },
]